package com.hl.service.impl;

import com.hl.domain.Gongshi;
import com.hl.mapper.GongshiMapper;
import com.hl.service.GongShiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GongShiServiceImpl implements GongShiService {
    @Autowired
    private GongshiMapper gongshiMapper;

    @Override
    public List<Gongshi> findall() {
        return gongshiMapper.findall();
    }

    @Override
    public int update(Gongshi gongshi) {
        return gongshiMapper.updateByPrimaryKeySelective(gongshi);
    }

    @Override
    public int add(Gongshi gongshi) {
        return gongshiMapper.insert(gongshi);
    }

    @Override
    public int del(int id) {
        return gongshiMapper.deleteByPrimaryKey((long) id);
    }

    @Override
    public List<Gongshi> findLike(String name) {
        return gongshiMapper.findLike(name);
    }


}
